home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
nrpas13.arc
/
FTEST.DEM
< prev
next >
Wrap
Text File
|
1991-05-01
|
1KB
|
58 lines
PROGRAM d13r7(input,output);
(* driver for routine FTEST *)
CONST
npts=1000; (* npts must be > mpts for FTEST *)
mpts=500;
eps=0.04;
nval=10;
TYPE
gln1array = ARRAY [1..npts] OF real;
gln2array = ARRAY [1..mpts] OF real;
glnparray = gln1array;
VAR
glinext,glinextp : integer;
glma : ARRAY [1..55] OF real;
gliset : integer;
glgset : real;
f,factor,prob,vrnce : real;
i,idum,j : integer;
data1 : gln1array;
data2 : gln2array;
(*$I MODFILE.PAS *)
(*$I RAN3.PAS *)
(*$I GASDEV.PAS *)
(*$I GAMMLN.PAS *)
(*$I BETACF.PAS *)
(*$I BETAI.PAS *)
(*$I AVEVAR.PAS *)
(*$I FTEST.PAS *)
BEGIN
(* generate two gaussian distributions with
different variances *)
gliset := 0;
idum := -144;
writeln;
writeln('Variance 1 = ':16,1.0:5:2);
writeln('Variance 2':13,'Ratio':11,'Probability':16);
FOR i := 1 to (nval+1) DO BEGIN
FOR j := 1 to npts DO BEGIN
data1[j] := gasdev(idum)
END;
vrnce := 1.0+(i-1)*eps;
factor := sqrt(vrnce);
FOR j := 1 to mpts DO BEGIN
data2[j] := factor*gasdev(idum)
END;
ftest(data1,npts,data2,mpts,f,prob);
writeln(vrnce:11:4,f:13:4,prob:13:4)
END
END.